

#include "CSceneNodeAnimatorRotation.h"

namespace irr
{
    namespace scene
    {

        //! constructor
        CSceneNodeAnimatorRotation::CSceneNodeAnimatorRotation(u32 time, const core::vector3df& rotation)
            : Rotation(rotation), StartTime(time)
        {
#ifdef _DEBUG
            setDebugName("CSceneNodeAnimatorRotation");
#endif
        }


        //! destructor
        CSceneNodeAnimatorRotation::~CSceneNodeAnimatorRotation()
        {
        }



        //! animates a scene node
        void CSceneNodeAnimatorRotation::animateNode(ISceneNode* node, u32 timeMs)
        {
            if (node) // thanks to warui for this fix
            { 
                core::vector3df NewRotation = node->getRotation(); 
                NewRotation += Rotation* ((timeMs-StartTime)/10.0f); 
                node->setRotation(NewRotation); 
                StartTime=timeMs; 
            }
        }


    } // end namespace scene
} // end namespace irr

